#include <iostream>
#include "simple_cache.h"

using namespace std;
using namespace manifold::kernel;
using namespace manifold::simple_cache;


simple_cache::simple_cache(int id)
{ 
  myID = id;
}


void simple_cache::LinkArrival (int src, cache_req* req)
{
  cout << " ** current thread's id is " << req->source_id << endl;
  cout << " ** current thread's request id is " << req->req_id << endl;
  assert ( req->op_type == OpMemLd || req->op_type == OpMemSt );
  if ( req->op_type == OpMemLd )
  {
    cout << " ************LOAD " << hex << req->addr << " ************" << endl; 
  }
  else
  {
    cout << " ************Store " << hex << req->addr << " ************" << endl; 
  }
  Send<cache_req*>(0, req);
  cout << " sent from cache " << endl; 
}





